package com.eslserver.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.eslserver.to.ESL;
import com.eslserver.to.Image;
import com.eslserver.to.wrapper.ImageWrapper;

public class DAOHelperUtil {

	public static final Logger LOG = LoggerFactory
			.getLogger(DAOHelperUtil.class);

	public static String getImagePathByESLID(ESL esl) {
		String imagePath = null;
		Image eslImage = esl.getImages().size() > 0 ? esl.getImages()
				.iterator().next() : null;

		if (eslImage != null) {
			imagePath = ImageWrapper.createESLImageWrapper(eslImage)
					.getDownloadURL();
		}
		return imagePath;
	}

}
